package cn.lb.framework.poi.excel.entity.result;

import org.apache.poi.ss.usermodel.Workbook;

import java.util.List;
import java.util.Map;

/**
 * 导入返回类
 *
 */
public class ExcelImportResult<T> {

    /**
     * 结果集
     */
    private List<T> list;

    /**
     * 是否存在校验失败
     */
    private boolean verfiyFail;
    /**
     * 文件保存路径
     */
    private String filePath;
    /**
     * 校验错误信息
     */
    private String verfiyMsg;

    /**
     * 数据源
     */
    private Workbook workbook;

    /**
     * 判断是07还是03表格
     */
    private boolean isXSSFWorkbook;
    /**
     * 验证失败提示
     */
    private Map<String,String> errorMsg;

    public ExcelImportResult() {

    }

    public ExcelImportResult(List<T> list, boolean verfiyFail, Workbook workbook) {
        this.list = list;
        this.verfiyFail = verfiyFail;
        this.workbook = workbook;
    }

    public ExcelImportResult(List<T> list, boolean verfiyFail, Workbook workbook, boolean isXSSFWorkbook) {
        this.list = list;
        this.verfiyFail = verfiyFail;
        this.workbook = workbook;
        this.isXSSFWorkbook=isXSSFWorkbook;
    }

    public ExcelImportResult(List<T> list, boolean verfiyFail, Workbook workbook, boolean isXSSFWorkbook, Map<String, String> errorMsg) {
        this.list = list;
        this.verfiyFail = verfiyFail;
        this.workbook = workbook;
        this.isXSSFWorkbook=isXSSFWorkbook;
        this.errorMsg=errorMsg;
    }

    public ExcelImportResult(List<T> list, boolean verfiyFail, Workbook workbook, String filePath) {
        this.list = list;
        this.verfiyFail = verfiyFail;
        this.workbook = workbook;
        this.filePath = filePath;
    }

    public ExcelImportResult(boolean verfiyFail, String verfiyMsg, Workbook workbook) {
        this.workbook = workbook;
        this.verfiyMsg = verfiyMsg;
        this.verfiyFail = verfiyFail;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public Workbook getWorkbook() {
        return workbook;
    }

    public void setWorkbook(Workbook workbook) {
        this.workbook = workbook;
    }

    public boolean isVerfiyFail() {
        return verfiyFail;
    }

    public void setVerfiyFail(boolean verfiyFail) {
        this.verfiyFail = verfiyFail;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public String getVerfiyMsg() {
        return verfiyMsg;
    }

    public void setVerfiyMsg(String verfiyMsg) {
        this.verfiyMsg = verfiyMsg;
    }

    public boolean isXSSFWorkbook() {
        return isXSSFWorkbook;
    }

    public void setIsXSSFWorkbook(boolean isXSSFWorkbook) {
        this.isXSSFWorkbook = isXSSFWorkbook;
    }

    public Map<String,String> getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(Map<String,String> errorMsg) {
        this.errorMsg = errorMsg;
    }
}
